package com.example.mapper;

import com.example.entity.Grid;
import com.example.entity.GridReservation;
import java.util.List;
import lombok.RequiredArgsConstructor;
import org.apache.ibatis.annotations.Select;

/**
*  位置预订的持久层
**/
public interface GridReservationMapper {
   
   /**
   * 增
   **/
   int insert(GridReservation gridReservation);
   
   /**
   * 删
   **/
   int deleteById(Integer id);
   
   /**
   * 改
   **/
   int updateById(GridReservation gridReservation);
   
   /**
   * 根据ID查询
   **/
   GridReservation selectById(Integer id);
   
   /**
   * 查询所有
   **/
   List<GridReservation> selectAll(GridReservation gridReservation);

   @Select("select * from grid_reservation where grid_id = #{gridId} and time > now() limit 1")
    Grid selectByGId(Integer gridId);
}